Diango is a web development framework of Python. The purpose of the framework is to provide convenience for development, although it may be difficult at the beginning of learning. The book being read is practical Django projects.
TheOne example is a simple Content Management System CMS (Contents ManagementSystem ). Django
I just developed a set of content management system based on Django and PURECSS, the goal is normative, concise, practical, the current function is still in perfect.The system refers to Andrew Liu's online tutorial, in addition to the article management, search, but also added the category
User Management Section of Django's blog website (using its own django. contrib. auth) 1. Registration Section, django. contrib. auth
Project tool: Python 2.7.11 Django 1.10.2 Bootstrap 3.3.0 IDE: eclipse Pydev
1. Make sure that 'django. contrib. auth' already exists in sett
Added Rich Text function for Django content, django content text
Rich Text is missing, which is too simple to be viewed and read.
A feasible method is recorded as follows:
1-download the third-party Rich Text KindEditor and connect to http://kindeditor.net/down.php?baidu.
2-decompress the package to static/js under the
1. Django Site Management
It is really convenient and you don't have to develop it on your own, but it is often the enterprise-level background. I feel that the functions and beautification of the Django site background are not very good. Here is an article [Use grappelli to beautify the Django Admin background
[Django] design of the user permission Learning Series Self-owned permission management system design idea, django permission management system
If you encounter permission operation problems when reading this article, please refer to the first two chapters of this series!
Bytes
This article describes the idea of design
How to generate non-HTML content in django ., Django
In some cases, you may need to click a link or button on the webpage to return an image, a pdf file, a csv file, and so on, rather than HTML. It is easy to do this in diango. View in django is used to receive http requests and return web response. Normally, the retur
extremely useful for data editing (imagine ). If it is used to complete data entry, this management interface is truly unmatched. We suppose that most of the readers of this book have a pile of data input tasks.
The Django management interface pays special attention to users who have no technical background to use data input. this is also the purpose of this fu
Advanced content: How to write reusable applications
This article starts at the end of part seventh (en) of the tutorial. We will translate the previously written survey application into a separate Python package that can be reused in new projects and shared with others.
If you have not completed tutorial 1-7, we encourage you to complete them again so that you can match your project with the following tutorial. The problem of reusability
Designing,
"test-driven development" capability here. The error message prompts US: The user information has been saved to the database, but this is not what we want, because we do not pay!
Transactional transactions are used to save such problems ...
Transaction
For Django1.6, there are many ways to create transactions.
Here is a brief introduction to several.Recommended method
According to Django1.6 's documentation, "Django provides a simple API to control t
)AssertionError: 1 != 0 ----------------------------------------------------------------------
Like. This is the final result we want.
Remember: Here we have practiced "test-driven development. The error message prompts us that the user information has been saved to the database, but this is not what we want, because we have not paid!
Transaction is used to save such problems...
Transactions
For Django1.6, there are many ways to create transactions.
Here is a brief introduction to several types
paid for it!
Transaction transactions are used to salvage such problems ...
Transaction
There are a number of ways to create transactions for Django1.6.
Here is a brief introduction to several.
Recommended Methods
According to Django1.6 's documentation, "Django provides a simple API to control transaction transactions in the database ... Atomic operations are used to define the properties of a d
form, that is, set different types of input boxes#set name to text, cls_id as drop-down box classStudentform (Form): Name= fields. Charfield (widget=widgets. Inputtext ()) cls_id= fields. Integerfield (widget =widgets. Select ()) c. Set the contents of the drop-down box choices PropertiesclassStudentform (Form): cls_id=Fields . Integerfield (widget=widgets. Select (choices=models. Classes.objects.values_list ('ID','title')) Note: The value of choices must be a [tuple, (), ()] Type widget
; TD>{{Item.age}}TD> TD>{{Item.email}}TD> TD>{{item.cls_id}}TD> TD> ahref= "/app01/edit_student/nid={{Item.id}}"class= "Glyphicon glyphicon-pencil">Edita>| ahref= "/app01/del_student/nid={{Item.id}}"class= "Glyphicon Glyphicon-trash">Deletea> TD>{#点击删除是一个get请求, to tell the server ID, you can get it through a URL get request, or a URL match to a pass to the
The path to the admin interface is usually set in My_project, using django-admin.py startproject my_projectIn the urls.py file in the directory, you can seeFrom Django.conf.urls import include, urlfrom django.contrib import adminurlpatterns = [ # Examples: # URL (r ' ^$ ', ' My_project.views.home ', name= ' home '), # URL (r ' ^blog/', include (' Blog.urls ')), URL (r ' ^admin/', include ( Admin.site.urls)), URL (r ' ^$ ', ' my_project.
The User Management section of the Django blog site (using its own django.contrib.auth) 1. Registration sectionProject tools: Python 2.7.11 Django 1.10.2 Bootstrap 3.3.0 ide:eclipse Pydev1. Because Django comes with Auth, you only need to write the login URL and template.URLs common in the previous articleThe template
parameter in L #} {{l.0}} {# takes the value of key in the dictionary #} {{D.name}} {# Fetch the object's Name property #} {{Person_list.0.name}} {#. Operation can only invoke a method without parameters #} {{Person_list.0.dream}}FiltersSyntax: {{value|filter_name: parameter}}Default{{value|default: "Nothing"}}Show nothing if value is not passedLength{{Value|length}}| No space around no space no spacesReturns the length of value, such as value=[' A ', ' B ', ' C ', ' d '], which shows 4. File
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.